#include<bits/stdc++.h>
using namespace std;
#define int long long
#define L(i,a,b) for(int i=a;i<=b;i++)

int c[100];
int ans;
int s1,s2,s3,s4;
void dfs(int i,int left,int right,vector<int>&a,int s)
{
	L(x,1,1)
	{
		//if(c[i]==1)continue;
		if(i==s)
		{
			ans=min(ans,min(max(left,right+a[i]),max(left+a[i],right)));
			return;
		}
		c[i]=1;
		dfs(i+1,left+a[i],right,a,s);
		dfs(i+1,left,right+a[i],a,s);
		c[i]=0;
	}
}

signed main(){
	cin>>s1>>s2>>s3>>s4;
	vector<int>a(s1+1),b(s2+1),cc(s3+1),d(s4+1);
	L(i,1,s1)cin>>a[i];
	L(i,1,s2)cin>>b[i];
	L(i,1,s3)cin>>cc[i];
	L(i,1,s4)cin>>d[i];
	int tans=0,min_ans;
	min_ans=1e18;
	L(i,1,1){
		ans=1e9;
		c[i]=1;
		if(s1==1)min_ans=min(min_ans,a[i]);
		else{
			dfs(2,a[i],0,a,s1);
			dfs(2,0,a[i],a,s1);
		}
		c[i]=0;
		if(s1>1)min_ans=min(min_ans,ans);
	}
	tans+=min_ans;
	
	min_ans=1e18;
	L(i,1,1){
		ans=1e9;
		c[i]=1;
		if(s2==1)min_ans=min(min_ans,b[i]);
		else{
			dfs(2,b[i],0,b,s2);
			dfs(2,0,b[i],b,s2);
		}
		c[i]=0;
		if(s2>1)min_ans=min(min_ans,ans);
	}
	tans+=min_ans;
	
	min_ans=1e18;
	L(i,1,1){
		ans=1e9;
		c[i]=1;
		if(s3==1)min_ans=min(min_ans,cc[i]);
		else{
			dfs(2,cc[i],0,cc,s3);
			dfs(2,0,cc[i],cc,s3);
		}
		c[i]=0;
		if(s3>1)min_ans=min(min_ans,ans);
	}
	tans+=min_ans;
	
	min_ans=1e18;
	L(i,1,1){
		ans=1e9;
		c[i]=1;
		if(s4==1)min_ans=min(min_ans,d[i]);
		else{
			dfs(2,d[i],0,d,s4);
			dfs(2,0,d[i],d,s4);
		}
		c[i]=0;
		if(s4>1)min_ans=min(min_ans,ans);
	}
	tans+=min_ans;
	cout<<tans<<'\n';
	return 0;
}